package com.mjf.web.controller.common;

import com.mjf.common.core.domain.AjaxResult;
import com.mjf.ue.service.AsyncUEService;
import com.mjf.ue.service.IU8BarcodeService;
import com.mjf.ue.service.IU8ProductInService;
import com.mjf.ue.service.impl.U8BarcodeServiceImpl;
import com.mjf.ue.vo.BarCodeBatchGetParam;
import com.mjf.ue.vo.U8ProductInListParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import static com.mjf.common.core.domain.AjaxResult.success;

/**
 * <p>
 * desc
 * </p>
 *
 * @author chenshoumeng
 * @date 2025/6/3 15:12
 */
@RestController
@RequestMapping("/ue/async")
public class UEAsyncController {

    @Autowired
    private AsyncUEService asyncUEService;
    @Autowired
    private IU8ProductInService u8ProductInService;
    @Autowired
    private IU8BarcodeService u8BarcodeService;
    /**
     * 获取产成品入库订单列表
     */
    @PostMapping("/ccprkd")
    public Object getProductInOrderList(@RequestBody U8ProductInListParam param) {
        u8ProductInService.getProductInOrderList(param, true);
        return "success";
    }

    /**
     * 同步U8同步条码档案
     */
    @PostMapping("/bar/code")
    public AjaxResult syncU8BarCodeList(@RequestBody BarCodeBatchGetParam param) {
        u8BarcodeService.asyncBarcodeArchive(param);
        return success();
    }

}
